package com.neusoft.util;

import static org.assertj.core.api.Assertions.assertThatNullPointerException;

import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import com.neusoft.po.ResponseBean;

@RestControllerAdvice
public class GlobalExceptionDeal {
	// 空指针异常
	@ExceptionHandler(NullPointerException.class)
	@ResponseStatus(value=HttpStatus.INTERNAL_SERVER_ERROR)
	public ResponseBean dealNullException() {
		ResponseBean rb = new ResponseBean(500, "空指针异常");
		return rb;
	}
}
